<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box1 {
      /* float: left; */
      float: right;
      width: 50px;
      height: 50px;
      background-color: rgb(238, 39, 39);
    }

    .box2 {
      /* float: left; */
      float: right;
      width: 50px;
      height: 50px;
      background-color: rgb(228, 238, 39);
    }

    .box3 {
      /* float: left; */
      float: right;
      width: 50px;
      height: 50px;
      background-color: rgb(72, 238, 39);
    }

    ul li {
      list-style: none;
      /* float: left; */
      float: right;
      margin-left: 20px;
    }
  </style>
</head>

<body>
  <div class="box1"></div>
  <div class="box2"></div>
  <div class="box3"></div>
  <ul>
    <li>首页</li>
    <li>登录</li>
    <li>注册</li>
  </ul>
</body>

</html>